package com.wn.base.algorithm;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Set;

/**
 * @FileName: Node
 * @Description: 树节点
 * @Author: MaWenHao
 * @Created: 2020/11/20 - 11:06
 * @Version: V1.0
 * @Company: 东方微银科技（北京）有限公司
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class Node<T> {
    /**
     * 优势得分
     */
    private T score;
    /**
     * 取值范围
     */
    private Set<String> range;
    /**
     * 子节点集
     */
    private List<Node<T>> nextList;

    public boolean match(String value) {
        return range.contains(value);
    }
}
